3.10.5 \(\int \frac {1-x}{x \sqrt {1+3 x+x^2}} \, dx\)

Optimal. Leaf size=19 \[ -2 \tanh ^{-1}\left (\frac {x+1}{\sqrt {x^2+3 x+1}}\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {838, 206} \begin {gather*} -2 \tanh ^{-1}\left (\frac {x+1}{\sqrt {x^2+3 x+1}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 - x)/(x*Sqrt[1 + 3*x + x^2]),x]

[Out]

-2*ArcTanh[(1 + x)/Sqrt[1 + 3*x + x^2]]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 838

Int[((f_) + (g_.)*(x_))/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[(4*f
*(a - d))/(b*d - a*e), Subst[Int[1/(4*(a - d) - x^2), x], x, (2*(a - d) + (b - e)*x)/Sqrt[a + b*x + c*x^2]], x
] /; FreeQ[{a, b, c, d, e, f, g}, x] && EqQ[4*c*(a - d) - (b - e)^2, 0] && EqQ[e*f*(b - e) - 2*g*(b*d - a*e),
0] && NeQ[b*d - a*e, 0]

Rubi steps

\begin {align*} \int \frac {1-x}{x \sqrt {1+3 x+x^2}} \, dx &=-\left (4 \operatorname {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {2+2 x}{\sqrt {1+3 x+x^2}}\right )\right )\\ &=-2 \tanh ^{-1}\left (\frac {1+x}{\sqrt {1+3 x+x^2}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.01, size = 49, normalized size = 2.58 \begin {gather*} -\tanh ^{-1}\left (\frac {2 x+3}{2 \sqrt {x^2+3 x+1}}\right )-\tanh ^{-1}\left (\frac {3 x+2}{2 \sqrt {x^2+3 x+1}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 - x)/(x*Sqrt[1 + 3*x + x^2]),x]

[Out]

-ArcTanh[(3 + 2*x)/(2*Sqrt[1 + 3*x + x^2])] - ArcTanh[(2 + 3*x)/(2*Sqrt[1 + 3*x + x^2])]

________________________________________________________________________________________

IntegrateAlgebraic [B]  time = 0.16, size = 40, normalized size = 2.11 \begin {gather*} \log \left (2 \sqrt {x^2+3 x+1}-2 x-3\right )+2 \tanh ^{-1}\left (x-\sqrt {x^2+3 x+1}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

IntegrateAlgebraic[(1 - x)/(x*Sqrt[1 + 3*x + x^2]),x]

[Out]

2*ArcTanh[x - Sqrt[1 + 3*x + x^2]] + Log[-3 - 2*x + 2*Sqrt[1 + 3*x + x^2]]

________________________________________________________________________________________

fricas [B]  time = 0.42, size = 47, normalized size = 2.47 \begin {gather*} \log \left (4 \, x^{2} - \sqrt {x^{2} + 3 \, x + 1} {\left (4 \, x + 5\right )} + 11 \, x + 5\right ) - \log \left (-x + \sqrt {x^{2} + 3 \, x + 1} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-x)/x/(x^2+3*x+1)^(1/2),x, algorithm="fricas")

[Out]

log(4*x^2 - sqrt(x^2 + 3*x + 1)*(4*x + 5) + 11*x + 5) - log(-x + sqrt(x^2 + 3*x + 1) + 1)

________________________________________________________________________________________

giac [B]  time = 0.20, size = 56, normalized size = 2.95 \begin {gather*} -\log \left ({\left | -x + \sqrt {x^{2} + 3 \, x + 1} + 1 \right |}\right ) + \log \left ({\left | -x + \sqrt {x^{2} + 3 \, x + 1} - 1 \right |}\right ) + \log \left ({\left | -2 \, x + 2 \, \sqrt {x^{2} + 3 \, x + 1} - 3 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-x)/x/(x^2+3*x+1)^(1/2),x, algorithm="giac")

[Out]

-log(abs(-x + sqrt(x^2 + 3*x + 1) + 1)) + log(abs(-x + sqrt(x^2 + 3*x + 1) - 1)) + log(abs(-2*x + 2*sqrt(x^2 +
 3*x + 1) - 3))

________________________________________________________________________________________

maple [B]  time = 0.06, size = 38, normalized size = 2.00 \begin {gather*} -\arctanh \left (\frac {3 x +2}{2 \sqrt {x^{2}+3 x +1}}\right )-\ln \left (x +\frac {3}{2}+\sqrt {x^{2}+3 x +1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-x+1)/x/(x^2+3*x+1)^(1/2),x)

[Out]

-ln(x+3/2+(x^2+3*x+1)^(1/2))-arctanh(1/2*(3*x+2)/(x^2+3*x+1)^(1/2))

________________________________________________________________________________________

maxima [B]  time = 0.71, size = 48, normalized size = 2.53 \begin {gather*} -\log \left (2 \, x + 2 \, \sqrt {x^{2} + 3 \, x + 1} + 3\right ) - \log \left (\frac {2 \, \sqrt {x^{2} + 3 \, x + 1}}{{\left | x \right |}} + \frac {2}{{\left | x \right |}} + 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-x)/x/(x^2+3*x+1)^(1/2),x, algorithm="maxima")

[Out]

-log(2*x + 2*sqrt(x^2 + 3*x + 1) + 3) - log(2*sqrt(x^2 + 3*x + 1)/abs(x) + 2/abs(x) + 3)

________________________________________________________________________________________

mupad [B]  time = 1.83, size = 41, normalized size = 2.16 \begin {gather*} -\ln \left (\frac {3\,x+2\,\sqrt {x^2+3\,x+1}+2}{x}\right )-\ln \left (x+\sqrt {x^2+3\,x+1}+\frac {3}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(x - 1)/(x*(3*x + x^2 + 1)^(1/2)),x)

[Out]

- log((3*x + 2*(3*x + x^2 + 1)^(1/2) + 2)/x) - log(x + (3*x + x^2 + 1)^(1/2) + 3/2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \int \left (- \frac {1}{x \sqrt {x^{2} + 3 x + 1}}\right )\, dx - \int \frac {1}{\sqrt {x^{2} + 3 x + 1}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-x)/x/(x**2+3*x+1)**(1/2),x)

[Out]

-Integral(-1/(x*sqrt(x**2 + 3*x + 1)), x) - Integral(1/sqrt(x**2 + 3*x + 1), x)

________________________________________________________________________________________